<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{main::head}">
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="container-fluid">
    <form class="row g-3" th:object="${classes}" name="form" action="">
        <script th:if="${class}">
            window.alert("成功")
        </script>
        <div class="col-md-12">
            <input type="hidden" name="id_class" th:value="*{id_class}">
            <label class="form-label">班级名称</label>
            <input type="text" class="form-control" th:value="*{class_name}" placeholder="" name="class_name">
        </div>
        <div class="col-md-12">
            <label class="form-label">班级代码</label>
            <input type="text" class="form-control" placeholder="" th:value="*{class_number}" name="class_number">
        </div>
        <div class="col-12">
            <button type="submit" class="btn btn-primary" onclick="form.action='change-class';form.submit();" th:if="*{id_class}">保存</button>
            <button type=" submit" class="btn btn-primary"
                    onclick="form.action='add-class';form.submit();">保存为新班级
            </button>
            <button type="reset" class="btn btn-secondary">重置</button>
        </div>
    </form>
</div>

</body>
</html>